var t = getApp();

Page({
    data: {},
    onLoad: function(t) {
        if (t.diyUrl) {
            var n = t.diyUrl, e = wx.getStorageSync("yz_uid") || 0;
            t.mini && (n = "".concat(n, "?mini=1"), e && (n = "".concat(n, "&member_id=").concat(e))), 
            this.setData({
                link: n
            });
        } else t.src ? this.setData({
            link: decodeURIComponent(src)
        }) : t.isEplus ? this.getAgreementUrl() : this.getData();
    },
    getAgreementUrl: function() {
        var n = this, e = t.getNetAddresss("plugin.eplus-pay.frontend.agreement.agreementUrl");
        t._getNetWork({
            url: e,
            success: function(e) {
                var i = e.data;
                1 == i.result ? n.setData({
                    link: i.data.url
                }) : t.tips(i.msg);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareTimeline: function() {
        var t = null;
        return this.options.diyUrl && (t = "diyUrl=" + this.options.diyUrl), {
            query: t
        };
    },
    onShareAppMessage: function() {
        var t = "/packageI/web-view/h5View";
        return this.options.diyUrl && (t = t + "?diyUrl=" + this.options.diyUrl), {
            path: t
        };
    },
    getData: function() {
        var n = this, e = t.getNetAddresss("plugin.min-app.Frontend.Controllers.page.get-news-link");
        t._postNetWork({
            url: e,
            success: function(t) {
                var e = t.data;
                1 == e.result ? (console.log(e), n.setData({
                    link: e.data.url
                })) : wx.showToast({
                    title: e.msg,
                    duration: 1e3,
                    icon: "none"
                });
            }
        });
    }
});